home *** CD-ROM | disk | FTP | other *** search
/ Sound Fx / Sound Fx.iso / Software / UNZIPED / MPW181-5 / _SETUP.1 / layer3.h < prev    next >
Encoding:
C/C++ Source or Header  |  1997-04-19  |  1.9 KB  |  81 lines

  1. /* layer3.h
  2.  
  3.    Declarations for the Layer III decoder object */
  4.  
  5. #ifndef LAYERIII_H
  6. #define LAYERIII_H
  7.  
  8. #include "all.h"
  9. #include "l3type.h"
  10. #include "ibitstr.h"
  11. #include "obuffer.h"
  12. #include "bit_res.h"
  13. #include "header.h"
  14. #include "synfilt.h"
  15.  
  16. #define SSLIMIT 18
  17. #define SBLIMIT 32
  18.  
  19. /* Size of the table of whole numbers raised to 4/3 power.
  20.    This may be adjusted for performance without any problems. */
  21. #define POW_TABLE_LIMIT 512
  22.  
  23. class LayerIII_Decoder {
  24.  
  25. public:
  26.  
  27.     LayerIII_Decoder(Ibitstream *stream0, Header *header0,
  28.                         SynthesisFilter *filtera, SynthesisFilter *filterb,
  29.                     Obuffer *buffer0, enum e_channels which_ch0);
  30.  
  31.    ~LayerIII_Decoder();
  32.  
  33.    // Notify decoder that a seek is being made
  34.    void seek_notify();
  35.  
  36.    // Decode one frame, filling the buffer with the output samples
  37.     void decode();
  38.  
  39. private:
  40.  
  41.     // private data
  42.  
  43.     int32 is[SBLIMIT][SSLIMIT];
  44.    real  ro[2][SBLIMIT][SSLIMIT];
  45.    real  lr[2][SBLIMIT][SSLIMIT];
  46.     real  hybridIn[SBLIMIT][SSLIMIT];
  47.    real  re_hybridOut[SBLIMIT][SSLIMIT];
  48.    real  prevblck[2][SBLIMIT][SSLIMIT];
  49.  
  50.     Ibitstream *stream;
  51.    Header *header;
  52.    SynthesisFilter *filter1, *filter2;
  53.    Obuffer *buffer;
  54.    enum e_channels which_channels;
  55.    Bit_Reserve *br;
  56.    III_side_info_t *si;
  57.    III_scalefac_t scalefac;
  58.  
  59.    uint32 max_gr;
  60.    int32  frame_start;
  61.    int32  part2_start;
  62.    uint32 channels;
  63.    uint32 first_channel;
  64.    uint32 last_channel;
  65.  
  66.    // private member functions
  67.  
  68.     BOOL get_side_info();
  69.     void get_scale_factors(uint32 ch, uint32 gr);
  70.    void huffman_decode(uint32 ch, uint32 gr);
  71.     void dequantize_sample(real xr[SBLIMIT][SSLIMIT], uint32 ch, uint32 gr);
  72.     void reorder(real xr[SBLIMIT][SSLIMIT], uint32 ch, uint32 gr);
  73.     void stereo(uint32 gr);
  74.     void antialias(uint32 ch, uint32 gr);
  75.     void hybrid(uint32 ch, uint32 gr);
  76.    void do_downmix();
  77.  
  78. };
  79.  
  80. #endif
  81.